package com.wilmer.testRecords.service.impl;

import java.util.List;
import com.wilmer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.testRecords.mapper.YwTestRecordsMapper;
import com.wilmer.testRecords.domain.YwTestRecords;
import com.wilmer.testRecords.service.IYwTestRecordsService;

/**
 * 随堂测试记录Service业务层处理
 * 
 * @author zl
 * @date 2024-04-11
 */
@Service
public class YwTestRecordsServiceImpl implements IYwTestRecordsService 
{
    @Autowired
    private YwTestRecordsMapper ywTestRecordsMapper;

    /**
     * 查询随堂测试记录
     * 
     * @param recordId 随堂测试记录主键
     * @return 随堂测试记录
     */
    @Override
    public YwTestRecords selectYwTestRecordsByRecordId(Long recordId)
    {
        return ywTestRecordsMapper.selectYwTestRecordsByRecordId(recordId);
    }

    /**
     * 查询随堂测试记录列表
     * 
     * @param ywTestRecords 随堂测试记录
     * @return 随堂测试记录
     */
    @Override
    public List<YwTestRecords> selectYwTestRecordsList(YwTestRecords ywTestRecords)
    {
        return ywTestRecordsMapper.selectYwTestRecordsList(ywTestRecords);
    }

    /**
     * 新增随堂测试记录
     * 
     * @param ywTestRecords 随堂测试记录
     * @return 结果
     */
    @Override
    public int insertYwTestRecords(YwTestRecords ywTestRecords)
    {
        ywTestRecords.setCreateTime(DateUtils.getNowDate());
        return ywTestRecordsMapper.insertYwTestRecords(ywTestRecords);
    }

    /**
     * 修改随堂测试记录
     * 
     * @param ywTestRecords 随堂测试记录
     * @return 结果
     */
    @Override
    public int updateYwTestRecords(YwTestRecords ywTestRecords)
    {
        ywTestRecords.setUpdateTime(DateUtils.getNowDate());
        return ywTestRecordsMapper.updateYwTestRecords(ywTestRecords);
    }

    /**
     * 批量删除随堂测试记录
     * 
     * @param recordIds 需要删除的随堂测试记录主键
     * @return 结果
     */
    @Override
    public int deleteYwTestRecordsByRecordIds(Long[] recordIds)
    {
        return ywTestRecordsMapper.deleteYwTestRecordsByRecordIds(recordIds);
    }

    /**
     * 删除随堂测试记录信息
     * 
     * @param recordId 随堂测试记录主键
     * @return 结果
     */
    @Override
    public int deleteYwTestRecordsByRecordId(Long recordId)
    {
        return ywTestRecordsMapper.deleteYwTestRecordsByRecordId(recordId);
    }
}
